<!DOCTYPE html>
<html lang="zh-cmn-Hans">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">

		<title>海岛寻宝记</title>
		
		<link href="../css/iconfont.css"  rel="stylesheet" type="text/css" />
		<link href="../css/style.css" rel="stylesheet" type="text/css" />
		<script src="../js/jquery-2.1.1.min.js"></script>
	<body class="login_bg">		
		<div class="login_container">
			<div class="login_logo">
				<img src="../images/index_logo.png" />
			</div>
			<div class="login_bd">
				<img src="../images/login_bd.png" />
			</div>
			
			<div class="main_container">
				<div class="login_main_box">
					<ul>
						<li>
							<span><i class="iconfont">&#xe614;</i></span>
							<input id="username" name="用户名" type="text" placeholder="请输入用户名" />
						</li>
						<li>
							<span><i class="iconfont" style="font-size: 17px;">&#xe613;</i></span>
							<input id="password" name="密码" type="password" placeholder="请输入密码" />
						</li>
						<li>
							<span><i class="iconfont">&#xe615;</i></span>
							<input name="验证码" id="captcha" type="text" placeholder="请输入验证码" style="width: 65%;" />
							<span class="login_recaptcha"><a onclick="javascript:re_captcha();" ><img src="{{captcha_src()}}"  alt="验证码" title="刷新图片" width="100" height="40" id="c2c98f0de5a04167a9e427d883690ff6" border="0"></a></span>
						</li>
					</ul>				
				</div>
				<div class="login_input_box">
					<!-- {{csrf_field()}}	 -->
					<input type="hidden" name="_token" id="token" value="{{csrf_token()}}">				
					<input name="登录" type="button" class="login_input" value="登录" />					
				</div> 
				<div class="forgot_password">
					<p>忘记密码？<span><a href="javascript:">手机短信找回密码</a></span></p>
				</div>

			</div>						
		</div>
		<script>
			$('.login_input').click(function(){
				var username = $('#username').val();
				var password = $('#password').val();
				var captcha = $('#captcha').val();
				var _token  = $('#token').val();
				$.ajax({
					url:"{{ URL('home/login_input')}}",
					type:"post",
					data:{username:username,password:password,_token:_token,captcha:captcha},
					dataType:'json',
					success:function(msg){
						if(msg.status==1){
							alert(msg.msg);
							window.location.href = "{{ URL('home/home_index')}}";
						}else{
							alert(msg.msg);
						}
					}
				})
			})
			function re_captcha() {
				$url = "{{captcha_src()}}";
				$url = $url + "/" + Math.random();
				document.getElementById('c2c98f0de5a04167a9e427d883690ff6').src=$url;
			}
		</script>
	</body>
</html>
